package c.e.a.b.f.b;

import android.os.Bundle;
import android.text.TextUtils;
import b.i.b.f;
import com.google.android.gms.measurement.internal.zzap;
import java.util.Iterator;
import java.util.Objects;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class m {
    public final String a;
    public final String b;
    public final String c;
    public final long d;
    public final long e;
    public final zzap f;

    public m(u4 u4Var, String str, String str2, String str3, long j, long j2, zzap zzap) {
        f.N(str2);
        f.N(str3);
        Objects.requireNonNull(zzap, "null reference");
        this.a = str2;
        this.b = str3;
        if (TextUtils.isEmpty(str)) {
            str = null;
        }
        this.c = str;
        this.d = j;
        this.e = j2;
        if (j2 != 0 && j2 > j) {
            u4Var.d().i.c("Event created with reverse previous/current timestamps. appId, name", q3.s(str2), q3.s(str3));
        }
        this.f = zzap;
    }

    public final m a(u4 u4Var, long j) {
        return new m(u4Var, this.c, this.a, this.b, this.d, j, this.f);
    }

    public final String toString() {
        String str = this.a;
        String str2 = this.b;
        String valueOf = String.valueOf(this.f);
        StringBuilder stringBuilder = new StringBuilder(valueOf.length() + (String.valueOf(str2).length() + (String.valueOf(str).length() + 33)));
        stringBuilder.append("Event{appId='");
        stringBuilder.append(str);
        stringBuilder.append("', name='");
        stringBuilder.append(str2);
        stringBuilder.append("', params=");
        stringBuilder.append(valueOf);
        stringBuilder.append('}');
        return stringBuilder.toString();
    }

    public m(u4 u4Var, String str, String str2, String str3, long j, long j2, Bundle bundle) {
        zzap zzap;
        f.N(str2);
        f.N(str3);
        this.a = str2;
        this.b = str3;
        if (TextUtils.isEmpty(str)) {
            str = null;
        }
        this.c = str;
        this.d = j;
        this.e = j2;
        if (j2 != 0 && j2 > j) {
            u4Var.d().i.b("Event created with reverse previous/current timestamps. appId", q3.s(str2));
        }
        if (bundle.isEmpty()) {
            zzap = new zzap(new Bundle());
        } else {
            Bundle bundle2 = new Bundle(bundle);
            Iterator it = bundle2.keySet().iterator();
            while (it.hasNext()) {
                str3 = (String) it.next();
                if (str3 == null) {
                    u4Var.d().f.a("Param name can't be null");
                    it.remove();
                } else {
                    Object D = u4Var.t().D(str3, bundle2.get(str3));
                    if (D == null) {
                        u4Var.d().i.b("Param value can't be null", u4Var.u().x(str3));
                        it.remove();
                    } else {
                        u4Var.t().I(bundle2, str3, D);
                    }
                }
            }
            zzap = new zzap(bundle2);
        }
        this.f = zzap;
    }
}
